package com.jn.exam.question.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jn.exam.question.entity.Question;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jn.exam.question.entity.vo.QuestionWrapper;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Future;

/**
 * <p>
 * 总题库 服务类
 * </p>
 *
 * @author 江南大学1033190417
 * @since 2022-01-17
 */
public interface QuestionService extends IService<Question> {

    //通过id彻底删除
    Future<Boolean> completeDeleteById(String id);

    //分页查询
    List<Question> pageSelect(QuestionWrapper questionWrapper);

    Integer getPageTotal(QuestionWrapper questionWrapper);

    boolean completeDeleteByIds(String[] ids);

    List<Question> getDeletedQuestions();

    boolean recoveryDeleted(String[] ids);

    boolean deleteQuestionExpire(Date date);

    boolean removeByIds(String[] ids);

    Future<Boolean> deleteQuestionFile(String name, String answer);

    /**
     * 删除用户取出的图片
     *
     * @param old 之前的内容
     * @param now 现在的内容
     * @return 是否成功
     */
    boolean deleteNoExistUrl(String old,String now);
}
